package com.power.project.enums;

public enum MangeTypeEnum {

    SUPER_MANGE(3200, "超级管理员"),
    REGULAR_MANGE(3201, "普通管理员");

    private final int code;
    private final String description;

    MangeTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static MangeTypeEnum getEnum(int code) {
        for (MangeTypeEnum role : values()) {
            if (role.getCode() == code) {
                return role;
            }
        }
        throw new IllegalArgumentException("Invalid admin role code: " + code);
    }
}
